Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layer-shell: avoid crashes on unmap #7092

Merged
merged 1 commit into from
Jul 29, 2024
Merged

layer-shell: avoid crashes on unmap #7092

merged 1 commit into from
Jul 29, 2024

Conversation

VirtCode
Copy link
Contributor

Describe your PR, what does it fix/add?

Fixes a crash I had since today, where I would lock my PC, walk away, and come back to a crash in the tty. Turns out the crash is caused if a layer surface is unmapped while hyprland is locked. So if I was receiving notifications, whilst being on the lockscreen, it would crash.

The problem is that the LastFocus would contain the session-lock surface, which for some reason doesn't have an associated hlSurface, which would however still be accessed and thus segfault. So it seems to be introduced by 963816b, and a null check does the trick.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Didn't look in too deeply, as I don't have too much time currently, so I don't really know why hlSurface is null for the session-lock surface in the first place. But from looking around other code it seems to be expected.

Is it ready for merging, or does it need work?

Yes

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the use case for not crashing

@vaxerski vaxerski merged commit 6e6c61b into hyprwm:main Jul 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants